﻿using System;
using Microsoft.Office.Interop.Excel;

namespace YJKCodeBase.ExcelUtility.ModelLayer
{
	public class Chart
	{
		internal Chart(object thisObject)
		{
			this.m_chart = thisObject;
		}

		public bool HasTitle
		{
			get
			{
				return (bool)ExcelUtilityMethod.GetProperty(this.m_chart, "HasTitle");
			}
			set
			{
				ExcelUtilityMethod.SetProperty(this.m_chart, "HasTitle", new object[]
				{
					value
				});
			}
		}

		public void SetSourceData(Range input)
		{
			XlRowCol xlRowCol = XlRowCol.xlColumns;
			ExcelUtilityMethod.UseMethod(this.m_chart, "SetSourceData", new object[]
			{
				input.ThisRangeObject,
				xlRowCol
			});
		}

		public void ApplyDataLabels()
		{
			ExcelUtilityMethod.UseMethod(this.m_chart, "ApplyDataLabels", null);
		}

		public string ChartTitle
		{
			get
			{
				object property = ExcelUtilityMethod.GetProperty(this.m_chart, "ChartTitle");
				return (string)ExcelUtilityMethod.GetProperty(property, "Text");
			}
			set
			{
				object property = ExcelUtilityMethod.GetProperty(this.m_chart, "ChartTitle");
				ExcelUtilityMethod.SetProperty(property, "Text", new object[]
				{
					value
				});
			}
		}

		private object m_chart;
	}
}
